jQuery(document).ready(function($) {
    $(".scroll").click(function(event){
        event.preventDefault();
        $('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
    });
});
/*register*/
function registerUser() {
    var email = document.getElementById("Email").value;
    var username = document.getElementById("Name").value;
    var area = document.getElementById("Area").value;
    var password = document.getElementById("password").value;
    var psdAgain = document.getElementById("passwordAgain").value;

    if(password != psdAgain){
        alert("两次密码输入不一致！请再次输入！");
    }else {
        $.ajax({
            url:"http://123.206.47.215:8081/club_student/studentRegister",
            type:"POST",
            data:
                {
                    "email":$("#email").val(),
                    "area":$("#area").val(),
                    "username":$("#userName").val(),
                    "password":$("#password").val()
                },
            dataType:"json",
            success: function (data) {
                alert(data.toString());
                if (data.success=="false") {
                    alert("注册失败！");
                }else {
                    alert("success");

                }
            },
            error: function () {
                alert("请求失败！")
            }
        })
    }

}